#include "peoplemes.h"
#include "ui_peoplemes.h"

PeopleMes::PeopleMes(QWidget *parent,QVariant c,QString t,QPixmap pm,bool own)
    : QWidget(parent)
    , ui(new Ui::PeopleMes)
{
    ui->setupUi(this);
    init(c,t,pm,own);
}



PeopleMes::~PeopleMes()
{
    delete ui;
}

void PeopleMes::init(QVariant Content, QString Time,QPixmap pm1,bool own)
{
    content=Content;
    Isown=own;
    datetime=Time;
    pm=pm1;
    ui->image->setPixmap(pm);
    ui->image->setScaledContents(true);
    ui->time->setText(Time);
    if(Isown)
    {
        ui->mesedit->setStyleSheet(QString("background-color:green"));
    }

    if(content.canConvert(QMetaType::QString))
    {
        ui->mesedit->setPlainText(content.value<QString>());
    }

}
